<?xml version="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:ns="urn:iNSISt:schemas:code-generation-1.0"
                xmlns:str="http://exslt.org/strings"
                xmlns:exsl="http://exslt.org/common"
                extension-element-prefixes="str exsl">
  <xsl:output method="text" omit-xml-declaration="yes" encoding="iso-8859-1" />
  <xsl:variable name="constants">
    <c>$PROGRAMFILES</c>
    <c>$PROGRAMFILES32</c>
    <c>$PROGRAMFILES64</c>
    <c>$COMMONFILES</c>
    <c>$COMMONFILES32</c>
    <c>$COMMONFILES64</c>
    <c>$DESKTOP</c>
    <c>$EXEDIR</c>
    <c>$EXEFILE</c>
    <c>$EXEPATH</c>
    <c>${NSISDIR}</c>
    <c>$WINDIR</c>
    <c>$SYSDIR</c>
    <c>$TEMP</c>
    <c>$STARTMENU</c>
    <c>$SMPROGRAMS</c>
    <c>$SMSTARTUP</c>
    <c>$QUICKLAUNCH</c>
    <c>$DOCUMENTS</c>
    <c>$SENDTO</c>
    <c>$RECENT</c>
    <c>$FAVORITES</c>
    <c>$MUSIC</c>
    <c>$PICTURES</c>
    <c>$VIDEOS</c>
    <c>$NETHOOD</c>
    <c>$FONTS</c>
    <c>$TEMPLATES</c>
    <c>$APPDATA</c>
    <c>$LOCALAPPDATA</c>
    <c>$PRINTHOOD</c>
    <c>$INTERNET_CACHE</c>
    <c>$COOKIES</c>
    <c>$HISTORY</c>
    <c>$PROFILE</c>
    <c>$ADMINTOOLS</c>
    <c>$RESOURCES</c>
    <c>$RESOURCES_LOCALIZED</c>
    <c>$CDBURN_AREA</c>
    <c>$HWNDPARENT</c>
    <c>$PLUGINSDIR</c>
  </xsl:variable>
  <xsl:template match="/ns:nsis">; Script generated using iNSISt Framework v1.0 (http://www.codeplex.com/insist)
<xsl:if test="ns:prerequisites/ns:dotNetFramework">
!include WordFunc.nsh
!insertmacro VersionCompare
!include LogicLib.nsh
</xsl:if>
!define PRODUCT_NAME "<xsl:value-of select="./ns:product/@name" />"
!define PRODUCT_VERSION "<xsl:value-of select="./ns:product/@version" />"
!define PRODUCT_PUBLISHER "<xsl:value-of select="./ns:product/@publisher" />"
!define PRODUCT_EXECUTABLE "<xsl:value-of select="./ns:executable" />"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_EXECUTABLE}"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
<xsl:if test="ns:ui/ns:modernUI">
; MUI 1.67 compatible
!include "MUI.nsh"

; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
<xsl:for-each select="./ns:ui/ns:modernUI/ns:installPages/node()">
  <xsl:if test="name() = 'welcomePage'">
; Welcome page<xsl:if test="@threeLineTitle = 'true'">
!define MUI_WELCOMEPAGE_TITLE_3LINES</xsl:if><xsl:if test="@title">
!define MUI_WELCOMEPAGE_TITLE "<xsl:value-of select="@title" />"</xsl:if><xsl:if test="@text">
!define MUI_WELCOMEPAGE_TEXT "<xsl:value-of select="@text" />"</xsl:if>
!insertmacro MUI_PAGE_WELCOME</xsl:if>

  <xsl:if test="name() = 'licensePage'">
; License page<xsl:if test="@topText">
!define MUI_LICENSEPAGE_TEXT_TOP "<xsl:value-of select="@topText" />"</xsl:if><xsl:if test="@bottomText">
!define MUI_LICENSEPAGE_TEXT_BOTTOM "<xsl:value-of select="@bottomText" />"</xsl:if><xsl:if test="@buttonText">
!define MUI_LICENSEPAGE_BUTTON "<xsl:value-of select="@buttonText" />"</xsl:if><xsl:if test="ns:checkbox">
!define MUI_LICENSEPAGE_CHECKBOX</xsl:if><xsl:if test="ns:checkbox/@text">
!define MUI_LICENSEPAGE_CHECKBOX_TEXT "<xsl:value-of select="ns:checkbox/@text" />"</xsl:if><xsl:if test="ns:radioButtons">
!define MUI_LICENSEPAGE_RADIOBUTTONS</xsl:if><xsl:if test="ns:radioButtons/@acceptText">
!define MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT "<xsl:value-of select="ns:radioButtons/@acceptText" />"</xsl:if><xsl:if test="ns:radioButtons/@declineText">
!define MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE "<xsl:value-of select="ns:radioButtons/@declineText"/>"</xsl:if>
!insertmacro MUI_PAGE_LICENSE "<xsl:value-of select="@textFile" />"</xsl:if>

  <xsl:if test="name() = 'componentsPage'">
; Components page<xsl:if test="@topText">
!define MUI_COMPONENTSPAGE_TEXT_TOP "<xsl:value-of select="@topText" />"</xsl:if><xsl:if test="@componentsListText">
!define MUI_COMPONENTSPAGE_TEXT_COMPLIST "<xsl:value-of select="@componentsListText" />"</xsl:if><xsl:if test="@installationTypeText">
!define MUI_COMPONENTSPAGE_TEXT_INSTTYPE "<xsl:value-of select="@installationTypeText" />"</xsl:if><xsl:if test="@descriptionTitleText">
!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE "<xsl:value-of select="@descriptionTitleText" />"</xsl:if><xsl:if test="@descriptionInfoText">
!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO "<xsl:value-of select="@descriptionInfoText" />"</xsl:if>
!insertmacro MUI_PAGE_COMPONENTS
  </xsl:if>
  
  <xsl:if test="name() = 'directoryPage'">
; Directory page<xsl:if test="@topText">
!define MUI_DIRECTORYPAGE_TEXT_TOP "<xsl:value-of select="@topText" />"</xsl:if><xsl:if test="@destinationText">
!define MUI_DIRECTORYPAGE_TEXT_DESTINATION "<xsl:value-of select="@destinationText" />"</xsl:if><xsl:if test="@verifyOnLeave = 'true'">
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE</xsl:if>
!insertmacro MUI_PAGE_DIRECTORY</xsl:if>

  <xsl:if test="name() = 'startMenuPage'">
; Start Menu page
Var <xsl:value-of select="substring-after(@variable, '$')" /><xsl:if test="@topText">
!define MUI_STARTMENUPAGE_TEXT_TOP "<xsl:value-of select="@topText" />"</xsl:if><xsl:if test="@folderCheckboxText">
!define MUI_STARTMENUPAGE_TEXT_CHECKBOX "<xsl:value-of select="@folderCheckboxText" />"</xsl:if><xsl:if test="@defaultFolder">
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "<xsl:value-of select="@defaultFolder" />"</xsl:if><xsl:if test="@displayDisableShortcutsCheckbox != 'true'">
!define MUI_STARTMENUPAGE_NODISABLE</xsl:if><xsl:if test="@registryRoot">
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "<xsl:value-of select="@registryRoot" />"</xsl:if><xsl:if test="@registryKey">
!define MUI_STARTMENUPAGE_REGISTRY_KEY "<xsl:value-of select="@registryKey" />"</xsl:if><xsl:if test="@registryValueName">
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "<xsl:value-of select="@registryValueName" />"</xsl:if>
!insertmacro MUI_PAGE_STARTMENU "<xsl:value-of select="@pageId" />" <xsl:value-of select="@variable" />
  </xsl:if>
  
  <xsl:if test="name() = 'instFilesPage'">
; Instfiles page<xsl:if test="@finishHeaderText">
!define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "<xsl:value-of select="@finishHeaderText" />"</xsl:if><xsl:if test="@finishHeaderSubText">
!define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "<xsl:value-of select="@finishHeaderSubText" />"</xsl:if><xsl:if test="@abortHeaderText">
!define MUI_INSTFILESPAGE_ABORTHEADER_TEXT "<xsl:value-of select="@abortHeaderText" />"</xsl:if><xsl:if test="@abortHeaderSubText">
!define MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT "<xsl:value-of select="@abortHeaderSubText" />"</xsl:if>
!insertmacro MUI_PAGE_INSTFILES</xsl:if>

  <xsl:if test="name() = 'finishPage'">
; Finish page<xsl:if test="@title">
!define MUI_FINISHPAGE_TITLE "<xsl:value-of select="@title" />"</xsl:if><xsl:if test="@threeLineTitle = 'true'">
!define MUI_FINISHPAGE_TITLE_3LINES</xsl:if><xsl:if test="@text">
!define MUI_FINISHPAGE_TEXT "<xsl:value-of select="@text" />"</xsl:if><xsl:if test="@extraSpaceForText = 'true'">
!define MUI_FINISHPAGE_TEXT_LARGE</xsl:if><xsl:if test="@buttonText">
!define MUI_FINISHPAGE_BUTTON "<xsl:value-of select="@buttonText" />"</xsl:if><xsl:if test="@cancelEnabled = 'true'">
!define MUI_FINISHPAGE_CANCEL_ENABLED</xsl:if><xsl:if test="@rebootText">
!define MUI_FINISHPAGE_TEXT_REBOOT "<xsl:value-of select="@rebootText" />"</xsl:if><xsl:if test="@rebootNowText">
!define MUI_FINISHPAGE_TEXT_REBOOTNOW "<xsl:value-of select="@rebootNowText" />"</xsl:if><xsl:if test="@rebootLaterText">
!define MUI_FINISHPAGE_TEXT_REBOOTLATER "<xsl:value-of select="@rebootLaterText" />"</xsl:if><xsl:if test="@defaultToRebootLater = 'true'">
!define MUI_FINISHPAGE_REBOOTLATER_DEFAULT</xsl:if><xsl:if test="ns:run/@file">
!define MUI_FINISHPAGE_RUN <xsl:value-of select="ns:run/@file"/></xsl:if><xsl:if test="ns:run/@text">
!define MUI_FINISHPAGE_RUN_TEXT "<xsl:value-of select="ns:run/@text"/>"</xsl:if><xsl:if test="ns:run/@parameters">
!define MUI_FINISHPAGE_RUN_PARAMETERS "<xsl:value-of select="ns:run/@parameters"/>"</xsl:if><xsl:if test="ns:run/@checked != 'true'">
!define MUI_FINISHPAGE_RUN_NOTCHECKED</xsl:if><xsl:if test="ns:showReadMe/@file">
!define MUI_FINISHPAGE_SHOWREADME "<xsl:value-of select="ns:showReadMe/@file"/>"</xsl:if><xsl:if test="ns:showReadMe/@text">
!define MUI_FINISHPAGE_SHOWREADMETEXT "<xsl:value-of select="ns:showReadMe/@text" />"</xsl:if><xsl:if test="ns:showReadMe/@checked != 'true'">
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED</xsl:if><xsl:if test="ns:link/@text">
!define MUI_FINISHPAGE_LINK "<xsl:value-of select="ns:link/@text" />"</xsl:if><xsl:if test="ns:link/@location">
!define MUI_FINISHPAGE_LINK_LOCATION "<xsl:value-of select="ns:link/@location" />"</xsl:if><xsl:if test="ns:link/@color">
!define MUI_FINISHPAGE_LINK_COLOR "<xsl:value-of select="ns:link/@color" />"</xsl:if><xsl:if test="@noRebootSupport = 'true'">
!define MUI_FINISHPAGE_NOREBOOTSUPPORT</xsl:if>
!insertmacro MUI_PAGE_FINISH</xsl:if>
</xsl:for-each>
    
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES

; Language files
!insertmacro MUI_LANGUAGE "English"
</xsl:if>
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "<xsl:value-of select="./ns:outfile" />"
InstallDir "<xsl:value-of select="./ns:installDir" />"<xsl:choose><xsl:when test="ns:ui/ns:modernUI">
ShowInstDetails show
ShowUnInstDetails show</xsl:when><xsl:otherwise>
Icon "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
UninstallIcon "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
SilentInstall silent
SilentUninstall silent
</xsl:otherwise>
</xsl:choose>
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
<xsl:apply-templates select="ns:mainSection" />
<xsl:apply-templates select="ns:section" />
Section -AdditionalIcons
  <xsl:choose>
    <xsl:when test="ns:ui/ns:modernUI/ns:installPages/ns:startMenuPage">
      <xsl:apply-templates select="ns:ui/ns:modernUI/ns:installPages/ns:startMenuPage" mode="additionalIcons" />
    </xsl:when>
    <xsl:otherwise>CreateShortCut "$SMPROGRAMS\<xsl:value-of select="/ns:nsis/ns:product/@name" />\Uninstall.lnk" "$INSTDIR\uninst.exe"</xsl:otherwise>
  </xsl:choose>
SectionEnd

Section -Post
  WriteUninstaller "$INSTDIR\uninst.exe"
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\${PRODUCT_EXECUTABLE}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\${PRODUCT_EXECUTABLE}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
<xsl:if test="ns:ui">
; Section descriptions<xsl:choose>
  <xsl:when test="ns:ui/ns:modernUI">
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
<xsl:apply-templates select="/ns:nsis/ns:mainSection" mode="modernUIDescription" />
<xsl:apply-templates select="/ns:nsis/ns:section" mode="modernUIDescriptions" />!insertmacro MUI_FUNCTION_DESCRIPTION_END
  </xsl:when>
</xsl:choose>
</xsl:if>
<xsl:if test="ns:prerequisites/ns:dotNetFramework">
Var InstallDotNET
Function .onInit<xsl:if test="@ns:ui/ns:modernUI">
  !insertmacro MUI_LANGDLL_DISPLAY
  </xsl:if>
  ; Check .NET version
  StrCpy $InstallDotNET "No"
  Call GetDotNETVersion
  Pop $0

  ${If} $0 == "not found"
        StrCpy $InstallDotNET "Yes"
      MessageBox MB_OK|MB_ICONINFORMATION "${PRODUCT_NAME} requires that the .NET Framework 2.0 is installed. The .NET Framework will be downloaded and installed automatically during installation of ${PRODUCT_NAME}."
       Return
  ${EndIf}

  StrCpy $0 $0 "" 1 # skip "v"

  ${VersionCompare} $0 "2.0" $1
  ${If} $1 == 2
        StrCpy $InstallDotNET "Yes"
      MessageBox MB_OK|MB_ICONINFORMATION "${PRODUCT_NAME} requires that the .NET Framework 2.0 is installed. The .NET Framework will be downloaded and installed automatically during installation of ${PRODUCT_NAME}."
       Return
  ${EndIf}
FunctionEnd

Function GetDotNETVersion
    Push $0
    Push $1

    System::Call "mscoree::GetCORVersion(w .r0, i ${NSIS_MAX_STRLEN}, *i) i .r1"
    StrCmp $1 "error" 0 +2
    StrCpy $0 "not found"

    Pop $1
    Exch $0
FunctionEnd
</xsl:if>
Function un.onUninstSuccess
  HideWindow
  MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd

Function un.onInit
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
  Abort
FunctionEnd

Section Uninstall
  <xsl:apply-templates select="ns:fileGroup" mode="delete" />

  <xsl:choose>
    <xsl:when test="ns:ui/ns:modernUI/ns:installPages/ns:startMenuPage">
      <xsl:apply-templates select="./ns:ui/ns:modernUI/ns:installPages/ns:startMenuPage" mode="delete" />
    </xsl:when>
    <xsl:otherwise>
  Delete "$SMPROGRAMS\<xsl:value-of select="./ns:product/@name" />\Uninstall.lnk"
  Delete "$SMPROGRAMS\<xsl:value-of select="./ns:product/@name" />\<xsl:value-of select="./ns:product/@name" />.lnk"
  RMDir "$SMPROGRAMS\<xsl:value-of select="./ns:product/@name" />"
    </xsl:otherwise>
  </xsl:choose>

  <xsl:apply-templates select="ns:shortcutGroup" mode="delete" />
  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"

  Delete "$INSTDIR\${PRODUCT_EXECUTABLE}"
  Delete "$INSTDIR\uninst.exe"
  RMDir "$INSTDIR"
  
  SetAutoClose true
SectionEnd
  </xsl:template>

  <xsl:template match="ns:mainSection">
Section "MainSection" SEC_Main
  SetOverwrite ifnewer
  <xsl:if test="ns:prerequisites/ns:dotNetFramework">
  ; Get .NET if required
  ${If} $InstallDotNET == "Yes"
     SetDetailsView hide
     inetc::get /caption "Downloading .NET Framework 2.0" /canceltext "Cancel" "http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe" "$INSTDIR\dotnetfx.exe" /end
     Pop $1

     ${If} $1 != "OK"
           Delete "$INSTDIR\dotnetfx.exe"
           Abort "Installation cancelled."
     ${EndIf}

     ExecWait "$INSTDIR\dotnetfx.exe<xsl:if test="not(../../ns:ui/ns:modernUI)"> /q /c:$\"install.exe /q$\"</xsl:if>"
     Delete "$INSTDIR\dotnetfx.exe"

     SetDetailsView show
  ${EndIf}
  </xsl:if>
  SetOutPath "$INSTDIR"
  File "<xsl:value-of select="str:replace(concat(/ns:nsis/ns:executable/@path, '\'), '\\', '\')" />${PRODUCT_EXECUTABLE}"
  <xsl:apply-templates select="./ns:fileGroup" mode="create" />
  <xsl:choose>
    <xsl:when test="ns:ui/ns:modernUI/ns:installPages/ns:startMenuPage">
      <xsl:apply-templates select="ns:ui/ns:modernUI/ns:installPages/ns:startMenuPage" mode="create" />
    </xsl:when>
    <xsl:otherwise>
  CreateDirectory "$SMPROGRAMS\<xsl:value-of select="/ns:nsis/ns:product/@name" />"
  CreateShortCut "$SMPROGRAMS\<xsl:value-of select="/ns:nsis/ns:product/@name" />\<xsl:value-of select="/ns:nsis/ns:product/@name" />.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"</xsl:otherwise>
  </xsl:choose>
  <xsl:apply-templates select="ns:shortcutGroup" mode="create" />
SectionEnd
  </xsl:template>

  <xsl:template match="ns:section">
Section<xsl:if test="@selected = 'false'"> /o</xsl:if> "<xsl:choose><xsl:when test="@style='bold'">!</xsl:when><xsl:when test="@style='hidden'">-</xsl:when></xsl:choose><xsl:value-of select="@name" />" <xsl:value-of select="@index" />
  SetOverwrite ifnewer
  <xsl:apply-templates select="./ns:fileGroup" mode="create" />
  <xsl:apply-templates select="./ns:shortcutGroup" mode="create" />SectionEnd
  </xsl:template>

  <xsl:template match="ns:mainSection" mode="modernUIDescription" xml:space="preserve">  !insertmacro MUI_DESCRIPTION_TEXT ${SEC_Main} "<xsl:value-of select="@description" />"
</xsl:template>
  
  <xsl:template match="ns:section" mode="modernUIDescriptions" xml:space="preserve">  !insertmacro MUI_DESCRIPTION_TEXT ${<xsl:value-of select="@index" />} "<xsl:value-of select="@description" />"
</xsl:template>

  <xsl:template match="ns:fileGroup" mode="create">
  SetOutPath "<xsl:value-of select="@destination" />"
  
<xsl:apply-templates select="ns:file" mode="create" />
  </xsl:template>

  <xsl:template match="ns:fileGroup" mode="delete">
    <xsl:apply-templates select="ns:file" mode="delete" />
    <xsl:if test="not(exsl:node-set($constants)/c = @destination)">RMDir "<xsl:value-of select="@destination" />"
    </xsl:if>
  </xsl:template>

  <xsl:template match="ns:file" mode="create">  File "<xsl:value-of select="." />"
</xsl:template>

  <xsl:template match="ns:file" mode="delete">Delete "<xsl:value-of select="str:replace(concat(../@destination, '\'), '\\', '\')" /><xsl:value-of select="str:split(., '\')[position() = last()]" />"
  </xsl:template>

  <xsl:template match="ns:shortcutGroup" mode="create">
    <xsl:if test="not(exsl:node-set($constants)/c = @destination)">
  CreateDirectory "<xsl:value-of select="@destination" />"</xsl:if>
  <xsl:apply-templates select="ns:shortcut" mode="create" />
  </xsl:template>

  <xsl:template match="ns:shortcutGroup" mode="delete">
    <xsl:apply-templates select="ns:shortcut" mode="delete" />
    <xsl:if test="not(exsl:node-set($constants)/c = @destination)">
  RMDir "<xsl:value-of select="@destination" />"
    </xsl:if>
  </xsl:template>

  <xsl:template match="ns:shortcut" mode="create">
  CreateShortCut "<xsl:value-of select="str:replace(concat(../@destination, '\'), '\\', '\')" /><xsl:value-of select="." />" "<xsl:value-of select="@target" />" "<xsl:value-of select="@parameters" />" "<xsl:value-of select="@icon" />"</xsl:template>

  <xsl:template match="ns:shortcut" mode="delete">
  Delete "<xsl:value-of select="str:replace(concat(../@destination, '\'), '\\', '\')" /><xsl:value-of select="." />"</xsl:template>

  <xsl:template match="ns:startMenuPage" mode="create">
  !insertmacro MUI_STARTMENU_WRITE_BEGIN "<xsl:value-of select="@pageId" />"
  CreateDirectory "$SMPROGRAMS\<xsl:value-of select="@variable" />"
  CreateShortCut "$SMPROGRAMS\<xsl:value-of select="@variable" />\<xsl:value-of select="/ns:nsis/ns:product/@name" />.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
  !insertmacro MUI_STARTMENU_WRITE_END
  </xsl:template>

  <xsl:template match="ns:startMenuPage" mode="additionalIcons">!insertmacro MUI_STARTMENU_WRITE_BEGIN "<xsl:value-of select="@pageId" />"
  CreateShortCut "$SMPROGRAMS\<xsl:value-of select="/ns:nsis/ns:product/@name" />\Uninstall.lnk" "$INSTDIR\uninst.exe"
  !insertmacro MUI_STARTMENU_WRITE_END</xsl:template>

  <xsl:template match="ns:startMenuPage" mode="delete">!insertmacro MUI_STARTMENU_GETFOLDER "<xsl:value-of select="@pageId" />" <xsl:value-of select="@variable" />
  Delete "$SMPROGRAMS\<xsl:value-of select="@variable" />\Uninstall.lnk"
  Delete "$SMPROGRAMS\<xsl:value-of select="@variable" />\<xsl:value-of select="/ns:nsis/ns:product/@name" />.lnk"
  RMDir "$SMPROGRAMS\<xsl:value-of select="@variable" />"
  </xsl:template>
</xsl:stylesheet>